package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.Reservation;
import com.zzyl.entity.TimeSlotCount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CustomerReservationMapper {
    /**
     * 根据用户ID和状态统计数量
     */
    Integer countByUserIdAndStatus(@Param("name") String userName, @Param("status") Integer status);

    List<TimeSlotCount> findTimeAfterTimestamp(Long timestamp);

    void insert(Reservation reservation);

    Page<Reservation> selectByPage(Integer status, String name, String mobile, Long timeStamp);

    List<Reservation> getByMobile(@Param("mobile") String mobile, @Param("timeStamp") Long timeStamp);

    void cancelReservation(Long id);
}
